'use strict'
class add {
  constructor() {
    this.param = '/'
  }

  async post(c) {
    let {mana_id,mana_password} = JSON.parse(c.body)
    //let {mana_id,mana_password} = c.query;
    //console.log(c)
    let mana = JSON.parse(c.body)
    //let mana = c.query;
    let a = c.service.fun;
    let result = 0;
    c.setHeader('content-type', 'text/html; charset=utf-8')

    let data = await a.sel('manager','',[],c.service.pool);
    console.log(data.rows)
    data.rows.forEach(item=>{
      if(item.mana_id == mana_id && item.mana_password == mana_password){
        result += 1
      }
    })
    c.send({
      type:'array',
      data:!!result
    })
  }
}

module.exports = add;
